<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj={
            name:"huanghuang",
            age:18,
            sex:"男"
        }
        // var obj2=obj;
        var obj2={};
        // console.log(obj2)
        obj2.name=obj.name;
        obj2.age=obj.age;
        // obj2.sex=obj.sex;
        console.log(obj2)
    </script>
</body>
</html>